home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / loginout / stuff.arc / STUFF.C next >
Text File  |  1989-03-27  |  612b  |  26 lines

  1. #include <stdio.h>
  2. main(int argc, char *argv[])
  3. {
  4.     char *text,*filename;        /* text is the text to put in the file */
  5.     FILE *infile,*ret;                /* filename is 1st arg, FILE is filehandle */
  6.     printf("STUFF v0.9 3/27/89 copyright Gabe J. Feder, & PaineWebber, Inc.\n");
  7.     if(argc>=3)
  8.     {
  9.             filename=argv[1];
  10.             text=argv[2];
  11.             }
  12.     else
  13.     {
  14.             printf("Incorrect syntax.\nTry STUFF <filename> '<text>'\n");
  15.             exit(1);
  16.             }
  17.     infile=fopen(filename,"w");
  18.     if(infile==NULL){
  19.         printf("Error opening the file.\n");
  20.         exit(2);
  21.         }
  22.     fprintf(infile,"%s\015",text);
  23.     fclose(infile);
  24.     }
  25.  
  26.